package org.creativor.rayson.common;

import static org.junit.Assert.assertNotNull;
import java.io.ByteArrayOutputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.PipedInputStream;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>PortableObjectTest</code> contains tests for the class
 * <code>{@link PortableObject}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 * 
 * @generatedBy CodePro at 11-5-7 上午2:51
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class PortableObjectTest {
	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(PortableObjectTest.class);
	}
	
	/**
	 * Perform pre-test initialization.
	 * 
	 * @throws Exception
	 *             if the initialization fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Before
	public void setUp() throws Exception {
		// TODO: add additional set up code here
	}
	
	/**
	 * Perform post-test clean-up.
	 * 
	 * @throws Exception
	 *             if the clean-up fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@After
	public void tearDown() throws Exception {
		// TODO: add additional tear down code here
	}
	
	/**
	 * Run the Object readObject(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = java.io.IOException.class)
	public void testReadObject_1() throws Exception {
		DataInput in = new DataInputStream(new PipedInputStream());
		
		Object result = PortableObject.readObject(in);
		
		// TODO: add additional test code here
		assertNotNull(result);
	}
	
	/**
	 * Run the Object readObject(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = java.io.IOException.class)
	public void testReadObject_2() throws Exception {
		DataInput in = new DataInputStream(new PipedInputStream());
		
		Object result = PortableObject.readObject(in);
		
		// TODO: add additional test code here
		assertNotNull(result);
	}
	
	/**
	 * Run the Object readObject(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = java.io.IOException.class)
	public void testReadObject_3() throws Exception {
		DataInput in = new DataInputStream(new PipedInputStream());
		
		Object result = PortableObject.readObject(in);
		
		// TODO: add additional test code here
		assertNotNull(result);
	}
	
	/**
	 * Run the Object readObject(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = java.io.IOException.class)
	public void testReadObject_4() throws Exception {
		DataInput in = new DataInputStream(new PipedInputStream());
		
		Object result = PortableObject.readObject(in);
		
		// TODO: add additional test code here
		assertNotNull(result);
	}
	
	/**
	 * Run the void verifyPortable(Class) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testVerifyPortable_1() throws Exception {
		Class klass = Object.class;
		
		PortableObject.verifyPortable(klass);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void verifyPortable(Class) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testVerifyPortable_2() throws Exception {
		Class klass = Object.class;
		
		PortableObject.verifyPortable(klass);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void verifyPortable(Class) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testVerifyPortable_3() throws Exception {
		Class klass = Object.class;
		
		PortableObject.verifyPortable(klass);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void verifyPortable(Class) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testVerifyPortable_4() throws Exception {
		Class klass = Object.class;
		
		PortableObject.verifyPortable(klass);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void writeObject(DataOutput,Object) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testWriteObject_1() throws Exception {
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());
		Object value = new Object();
		
		PortableObject.writeObject(out, value);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void writeObject(DataOutput,Object) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testWriteObject_2() throws Exception {
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());
		Object value = new Object();
		
		PortableObject.writeObject(out, value);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void writeObject(DataOutput,Object) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testWriteObject_3() throws Exception {
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());
		Object value = new Object();
		
		PortableObject.writeObject(out, value);
		
		// TODO: add additional test code here
	}
	
	/**
	 * Run the void writeObject(DataOutput,Object) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午2:51
	 */
	@Test(expected = org.creativor.rayson.exception.UnportableTypeException.class)
	public void testWriteObject_4() throws Exception {
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());
		Object value = new Object();
		
		PortableObject.writeObject(out, value);
		
		// TODO: add additional test code here
	}
}
